LZ77 (where “LZ” stands for Lempel-Ziv) is a lossless data compression algorithm that forms the basis of several ubiquitous compression schemes, including the deflate compression algorithm. The LZ77 algorithm performs compression by matching a current input data sequence with a reference to a copy of that data sequence existing earlier in the input data stream. When a match is found, the match is encoded by a length-distance (L, D) pair. The length-distance pair indicates the equivalent of the statement “go back D characters from the current input data location, and copy L characters from that location.”
To spot matches, an LZ77 encoder keeps track of the most recent data in the input data stream. The data structure in which this data is held is called a history window, which is a sliding window that updates with time. The encoder needs to keep this data to look for matches, and the decoder needs to keep this data to interpret the matches the encoder refers to. The larger the sliding window, the longer back the encoder may search for creating references.
In contemporary data processing and networking, deflate compression is often use to perform on-the-fly compression at the transmission end and decompression at the receiving end. Deflate compression is a standardized lossless data compression algorithm that uses a combination of the LZ77 compression and Huffman coding. The LZ77 compression and Huffman coding are serial in nature.